package com.wuyunonline.tracelog.interceptor;

import com.wuyunonline.tracelog.common.constant.TraceLogConstant;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.MDC;

/**
 * Feign traceId拦截器
 * @author wuyun
 */
public class TraceLogFeignInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate requestTemplate) {
        requestTemplate.header(TraceLogConstant.TRACE_ID, MDC.get(TraceLogConstant.TRACE_ID));

    }
}
